﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SAM_Edu.dao;
using SAM_Edu.entity;
using System.Windows.Forms;

namespace SAM_Edu.control
{
   public class SetupSoftware
    {

       static LicenseKey lk;
       static License l;
       public static void insertLicenseKey(string licensekey, int activationStatus, DateTime activationDTS, DateTime lastValidationDTS, int lastValidationStatus, int numbOfWarning)
       {
           lk = new LicenseKey(licensekey,activationStatus, activationDTS, lastValidationDTS, lastValidationStatus, numbOfWarning);
           bool result = daoLicenseKey.StoreLicenseKey(lk);
           if (result == true)
           {
               
           }
           else
           {
               MessageBox.Show("License registration failed!" + Environment.NewLine + "Contact Support for help!");
           }
       }
       public static void insertLicense(string licenseeName, string licenseeAddress, byte[] imagebyte)
       {
           l = new License(licenseeName, licenseeAddress, imagebyte);
           bool result = daoLicense.StoreLicense(l);
           if (result == true)
           {
               MessageBox.Show("License Registered! \n You may login with the default login and password!");
           }
           else
           {
               MessageBox.Show("License registration failed!" + Environment.NewLine + "Contact Support for help!");
           }
       }
    }
}
